import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import Paging from "@dfeidao/fd-w000010";
import p001 from './p001';

export default async function a003(fd: IFeidaoAiBrowserComponent, a: { page_no: number }) {// 分页
	// todo
	console.log('zj-000008:a003------start');
	const p = a.page_no;
	console.log('页码：', p);
	const n = fd.data.node.querySelector<HTMLInputElement>('[data-id="hidden_source_feature_name"]');
	const v = n.value;
	const res = await nodejs<{ res: Array<{}>; c: number }>('wyf-hManager/zj-000009/s001', {
		filter: {
			hidden_source_feature_name: '',
			pn: p
		}
	});
	console.log(res);
	render(fd, res, p001, 'p001', 'inner');
	const p1 = fd.data.node.querySelector<Paging>('[data-id="paging"]');
	const p2 = String(p);
	p1.setAttribute("page-no", p2);

	console.log('zj-000008:a003------end');
}
